package org.mdrtwell.swing.autocomplete;

import java.awt.GridLayout;
import java.util.Arrays;

import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.SwingUtilities;

public class AutoCompleteTest extends JPanel {
	String[]	ss	= new String[] { "陈林", "范瑞康", "郑健", "万炯", "田志丹", "刘强" };

	public AutoCompleteTest() {
		setLayout(new GridLayout(2, 2));
		Java2sAutoComboBox java2sAutoComboBox = new Java2sAutoComboBox(Arrays.asList(ss));
		add(java2sAutoComboBox);
		Java2sAutoTextField java2sAutoTextField = new Java2sAutoTextField(Arrays.asList(ss));
		java2sAutoTextField.setText("");
		add(java2sAutoTextField);
	}

	public static void main(String[] args) {
		SwingUtilities.invokeLater(new Runnable() {
			@Override
			public void run() {
				JFrame frame = new JFrame();
				frame.add(new AutoCompleteTest());
				frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
				frame.pack();
				frame.setVisible(true);
			}
		});
	}
}
